"use strict";
cc._RF.push(module, '3c448sm7ERFGonudseXdiiB', 'form');
// module/login/script/form.js

"use strict";

var qiPaiCommon = require("QiPaiCommon");
cc.Class({
	extends: qiPaiCommon,

	properties: {
		username: cc.EditBox,
		password: cc.EditBox
	},
	onLoad: function onLoad() {
		// this._prefab = cc.find("Canvas/login");
	},
	submit: function submit() {
		if (!this.username.string == "" && !this.password.string == "") {
			this.onClickClose();
			// if(cc.qipai.loadding.size() > 0){
			// 	let loadding = cc.qipai.loadding.get();
			// 	let root = cc.find("Canvas");
			// 	loadding.parent = root ;
			// 	this._animCtrl = loadding.getComponent(cc.Animation);
			// 	var animState = this._animCtrl.play("loadding");
			// 	animState.wrapMode = cc.WrapMode.Loop;
			// }
			// var xhr = cc.tools.http.httpPost("/api/login",{mobile:this.username.string , password:this.password.string},function(ret){
			// 	cc.tools.http.authorization = ret ;
			if (cc.qipai.gametype != null && cc.qipai.gametype != "") {
				//只定义了单一游戏类型 ，否则 进入游戏大厅
				this.scene(cc.qipai.gametype, this);
			} else {
				cc.qipai.gametype = "hall";
				this.scene(cc.qipai.gametype, this);
			}

			//  *获取注册或登录结果，如果密码验证通过，则登录成功，如果无用户，则直接注册成功
			//  *
			//  *


			// });

		} else {
			this.alert("请输入账号密码");
		}
	},
	error: function error(object, errmessage) {
		object.closeloadding(object.loaddingDialog);
		object.alert(errmessage);
	},
	onClickClose: function onClickClose() {
		this.closeOpenWin();
	},
	guest: function guest() {}
});

cc._RF.pop();